package org.sunflower.dogeggstudy.web;

import lombok.Data;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

/**
 * @description:
 * @author: TanJingyu
 * @create: 2021-11-28 16:43
 **/
@RestController
@RequestMapping("/hello")
public class HelloController {

    @GetMapping
    public String hello() {
        return "hello...";
    }

    @GetMapping("/param")
    public String createHello(HelloRequestParam param) {
        return param.getUserName();
    }

    @PostMapping("/file")
    public String file(MultipartFile tan) {
        return tan.getOriginalFilename();
    }

    @Data
    public static class HelloRequestParam {
        private String userName;
    }
}
